﻿using HK.Core.GUIEx.Protocol.Attribute;

namespace HK.Core.GUIEx.Attribute
{
    /// <summary>
    /// Attribute - MinMax
    /// </summary>
    public class IntMinMaxAttribute : GUIAttribute, IMinMaxAttribute<int>
    {
        
        /// <summary>
        /// 保护构造函数
        /// </summary>
        /// <param name="iCaption">标题</param>
        /// <param name="iMin">最小值</param>
        /// <param name="iMax">最大值</param>
        /// <param name="iTips">提示</param>
        /// <param name="iOptions">选项</param>
        public IntMinMaxAttribute(string iCaption, int iMin, int iMax, 
            string iTips = null, int iOptions = (int)GUIOperateOptions.MinMaxField)
        {
            Caption = iCaption;
            Min = iMin;
            Max = iMax;
            Tips = iTips;
            Options = iOptions;
        }
        
        /// <summary>
        /// 保护构造函数
        /// </summary>
        protected IntMinMaxAttribute() : base() {}

        /// <summary>
        /// Min Value
        /// </summary>
        public int Min { get; protected set; } = 0;

        /// <summary>
        /// Max Value
        /// </summary>
        public int Max { get; protected set; } = 0;
    }
    
    /// <summary>
    /// Attribute - MinMax - IntSlide
    /// </summary>
    public sealed class IntSlideMinMaxAttribute : IntMinMaxAttribute
    {
        /// <summary>
        /// 保护构造函数
        /// </summary>
        /// <param name="iCaption">标题</param>
        /// <param name="iMin">最小值</param>
        /// <param name="iMax">最大值</param>
        /// <param name="iTips">提示</param>
        /// <param name="iOptions">选项</param>
        public IntSlideMinMaxAttribute(string iCaption, int iMin, int iMax, 
            string iTips = null, int iOptions = (int)GUIOperateOptions.MinMaxField) : 
            base(iCaption, iMin, iMax, iTips, iOptions) { }
        
        /// <summary>
        /// 保护构造函数
        /// </summary>
        private IntSlideMinMaxAttribute() : base() {}
    }
    
    /// <summary>
    /// Attribute - MinMax - long
    /// </summary>
    public class LongMinMaxAttribute : GUIAttribute, IMinMaxAttribute<long>
    {
        
        /// <summary>
        /// 保护构造函数
        /// </summary>
        /// <param name="iCaption">标题</param>
        /// <param name="iMin">最小值</param>
        /// <param name="iMax">最大值</param>
        /// <param name="iTips">提示</param>
        /// <param name="iOptions">选项</param>
        public LongMinMaxAttribute(string iCaption, long iMin, long iMax, 
            string iTips = null, int iOptions = (int)GUIOperateOptions.MinMaxField)
        {
            Caption = iCaption;
            Min = iMin;
            Max = iMax;
            Tips = iTips;
            Options = iOptions;
        }
        
        /// <summary>
        /// 保护构造函数
        /// </summary>
        protected LongMinMaxAttribute() : base() {}

        /// <summary>
        /// Min Value
        /// </summary>
        public long Min { get; protected set; } = 0L;
        
        /// <summary>
        /// Max Value
        /// </summary>
        public long Max { get; protected set; } = 0L;
    }
    
    /// <summary>
    /// Attribute - MinMax - float
    /// </summary>
    public class FloatMinMaxAttribute : GUIAttribute, IMinMaxAttribute<float>
    {
        
        /// <summary>
        /// 保护构造函数
        /// </summary>
        /// <param name="iCaption">标题</param>
        /// <param name="iMin">最小值</param>
        /// <param name="iMax">最大值</param>
        /// <param name="iTips">提示</param>
        /// <param name="iOptions">选项</param>
        public FloatMinMaxAttribute(string iCaption, float iMin, float iMax, 
            string iTips = null, int iOptions = (int)GUIOperateOptions.MinMaxField)
        {
            Caption = iCaption;
            Min = iMin;
            Max = iMax;
            Tips = iTips;
            Options = iOptions;
        }
        
        /// <summary>
        /// 保护构造函数
        /// </summary>
        protected FloatMinMaxAttribute() : base() {}

        /// <summary>
        /// Min Value
        /// </summary>
        public float Min { get; protected set; } = 0.0f;
        
        /// <summary>
        /// Max Value
        /// </summary>
        public float Max { get; protected set; } = 0.0f;
    }
}
